package com.sluggard.security.manage.model.res;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
public class RouteRes {

    @Schema(description = "名称")
    private String name;

    @Schema(description = "路径")
    private String path;

    @Schema(description = "组件")
    private String component;

    @Schema(description = "重定向路径")
    private String redirectUrl;

    @Schema(description = "子路由")
    private List<RouteRes> children;

    @Schema(description = "元数据")
    private Map<String, Object> meta = new HashMap<>();

    public void put(String key, Object value) {
        meta.put(key, value);
    }

    public void putAll(Map<String, Object> map) {
        meta.putAll(map);
    }
}
